<form class="layui-form layui-form-pamel" name="form1" id="form1" method="post">
    <div class="searchbox demoTable" id="searchbox">
        <div class="layui-form-item">

            <div class="layui-inline">
                <label class="layui-form-label">部门名称：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" maxlength="50" name="deptName" id="deptName"
                           placeholder="请输入部门名称"/>
                </div>
            </div>
            <input type="button" value="查询" onclick="$.table.search()" class="layui-btn layui-btn-red"/>
        </div>
    </div>
</form>

<div style="overflow:auto;width: 100%;padding-bottom: 20px;">
    <table id="simple-table" class="layui-table" lay-filter="simple-table">
    </table>
    <script type="text/html" id="barTable">
        <a class="layui-icon layui-icon-edit colored7764" lay-event="editFlag" title="修改"></a>
        <a class="layui-icon layui-icon-delete colored7764" lay-event="delFlag" title="删除"></a>
    </script>
    <script type="text/html" id="toolbarTable">
        <div class="layui-inline" title="添加" lay-event="addFlag"><i class="layui-icon layui-icon-add-circle"></i></div>
        <div class="layui-inline" title="上传" lay-event="importExcel"><i class="layui-icon layui-icon-upload"></i></div>
        <div class="layui-inline" title="下载模板" lay-event="importTemplate"><i
                class="layui-icon layui-icon-download-circle"></i></div>
    </script>
</div>
<script type="text/javascript">

    var prefix = basePath + "system/dept";

    var options = {
        id: 'simple-table',
        url: prefix + '/getSysDeptlistPage',
        javaField: 'deptId',    //主键
        addUrl: prefix + '/toDeptAdd',   //添加
        deleteUrl: prefix + '/deleteDept',    //删除
        editUrl: prefix + '/toDeptEdit?deptId=',   //编辑
        exportUrl: prefix + '/exportSysUser',    //导出
        importTemplate: prefix + '/impTempDepartmentUrl',   //下载导入模板
        importTemplateUrl: prefix + '/impDepartmentUrl',    //导入
        width: 450,  //
        height: 500,  //开启头部工具栏右侧
        addFull: false, //弹出框最大化
        editFull: false, //弹出框最大化
        toolbar: '#toolbarTable',  //开启工具栏
        modalName: '用户',
        cols: [[
            {type: 'numbers', title: '序号', width: 50}
            ,{field: 'parentName', title: '上级部门'}
            , {field: 'deptName', title: '部门名称'}
            , {field: 'deptId', title: '部门编号'}
            , {field: 'remarks', title: '备注'}
            , {title: '操作', width: 178, align: 'center', toolbar: '#barTable'}
        ]],
        page: true
    };

    var init = $.table.init(options);


</script>
